package com.cssy.xxkj.logic.dao.impl;


import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicPayItemDAO;
import com.cssy.xxkj.logic.entity.LogicPayItemDO;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-10-08
 */
public class LogicPayItemDAOImpl extends SqlMapClientDaoSupport implements LogicPayItemDAO {

    /**
     * 插入数据
     * @param logicPayItemDO
     * @return 插入数据的主键
     */
    public String insertLogicPayItemDO(LogicPayItemDO logicPayItemDO) throws DataAccessException {
        Object id = getSqlMapClientTemplate().insert("LogicPayItem.insert", logicPayItemDO);
        return (String) id;
    }

    /**
     * 统计记录数
     * @param logicPayItemDO
     * @return 查出的记录数
     */
    public Integer countLogicPayItemDOByExample(LogicPayItemDO logicPayItemDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicPayItem.countByDOExample", logicPayItemDO);
        return count;
    }

    /**
     * 更新记录
     * @param logicPayItemDO
     * @return 受影响的行数
     */
    public Integer updateLogicPayItemDO(LogicPayItemDO logicPayItemDO) throws DataAccessException {
        int result = getSqlMapClientTemplate().update("LogicPayItem.update", logicPayItemDO);
        return result;
    }

    /**
     * 获取对象列表
     * @param logicPayItemDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicPayItemDO> findListByExample(LogicPayItemDO logicPayItemDO) throws DataAccessException {
        List<LogicPayItemDO> list = getSqlMapClientTemplate().queryForList("LogicPayItem.findListByDO", logicPayItemDO);
        return list;
    }

    /**
     * 根据主键获取logicPayItemDO
     * @param id
     * @return logicPayItemDO
     */
    public LogicPayItemDO findLogicPayItemDOByPrimaryKey(String id) throws DataAccessException {
        LogicPayItemDO logicPayItemDO = (LogicPayItemDO) getSqlMapClientTemplate().queryForObject("LogicPayItem.findByPrimaryKey", id);
        return logicPayItemDO;
    }

    /**
     * 删除记录
     * @param id
     * @return 受影响的行数
     */
    public Integer deleteLogicPayItemDOByPrimaryKey(String id) throws DataAccessException {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicPayItem.deleteByPrimaryKey", id);
        return rows;
    }
    @SuppressWarnings("unchecked")
	@Override
	public List<LogicPayItemDO> find(SearchConditions scs)
			throws DataAccessException {
		List<LogicPayItemDO> list=getSqlMapClientTemplate().queryForList("LogicPayItem_ex.find",scs);
		return null;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer i=(Integer)getSqlMapClientTemplate().queryForObject("LogicPayItem_ex.count",scs);
		return i;
	}
	
	@Override
	public List<LogicPayItemDO> findItemListByMap(Map<String, Object> paramMap)
			throws DataAccessException {
		List<LogicPayItemDO> list=getSqlMapClientTemplate().queryForList("LogicPayItem_ex.findListByMap",paramMap);
		return list;
	}

}